<template>
  <div class="search-music-right-singer">
    <div class="wrap">
      <div class="header">
        <div class="header-title">入驻歌手</div>
        <div class="header-more">查看全部></div>
      </div>
      <div class="main">
        <template v-for="item in singers" :key="item">
          <singer-card :name="item.name" :src="item.picUrl" :intrudce="item.alias[0]" />
        </template>
      </div>
      <div class="footer">
        <button>申请成为网易音乐人</button>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, onMounted, computed } from 'vue'
import { useStore } from 'vuex'

import SingerCard from './singer-card.vue'

export default defineComponent({
  components: {
    SingerCard
  },
  setup() {
    const store = useStore()
    onMounted(() => {
      store.dispatch('searchMusic/getInSinger')
    })
    const singers = computed(() => store.state.searchMusic.inSingers)
    return {
      singers
    }
  }
})
</script>

<style scoped lang="less">
.search-music-right-singer {
  width: 100%;
  height: 455px;
  .wrap {
    margin: auto;
    width: 90%;
    height: 95%;
    padding: 10px;
    .header {
      width: 100%;
      font-size: 10px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-bottom: 5px;
      margin-bottom: 10px;
      border-bottom: 1px solid #ccc;
      .header-title {
        color: #333;
        font-weight: 600;
        transform: scale(0.9);
      }
      .header-more {
        transform: scale(0.8);
        letter-spacing: 1px;
      }
    }
    .main {
      width: 100%;
    }
    .footer {
      width: 100%;
      height: 31px;
      button {
        width: 100%;
        height: 100%;
        border: 1px solid #ccc;
        border-radius: 4px;
        box-shadow: 0px 0px 2px #ccc;
        color: #333;
        font-size: 10px;
        font-weight: 500;
        background: linear-gradient(
          to bottom right,
          #e8e8e8,
          rgb(243, 241, 241)
        );
        &:hover {
          cursor: pointer;
          background: #fff;
        }
      }
    }
  }
}
</style>
